package com.king.micro.common;

import com.zeus.framework.commons.json.DataTransferObject;
import com.king.micro.common.entity.User;
import com.king.micro.common.exception.BusinessException;
import org.springframework.stereotype.Component;

/**
 * @author 赵晓光
 *         created 2017/11/10 15:16
 *         copyright 2017 micro
 * @FileName: SayHello.java
 * package: com.king.micro.common
 */
public class SayHello {

    public String say(String fid) {
        if ("1".equals(fid)) {
            User user = new User();
            user.setFid(fid);
            user.setName("zhoxg");
            DataTransferObject dto = new DataTransferObject();
            dto.putValue("data", user);
            return dto.toJsonString();
        } else {
            BusinessException businessException  = new BusinessException("nihao");
            throw businessException;
        }
    }
}
